package com.qixin.api.serviceimpl;

import com.qixin.api.bean.*;
import com.qixin.api.mapper.PtMoneyInfoMapper;
import com.qixin.api.service.PtMoneyInfoService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpSession;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 企业给用户分配资金回收资金记录表 服务实现类
 * </p>
 *
 *
 * @author 吕正睿
 * @since 2018-10-29
 */
@Service
public class PtMoneyInfoServiceImpl extends ServiceImpl<PtMoneyInfoMapper, PtMoneyInfo> implements PtMoneyInfoService {
    @Override
    public ResultPage<PtMoneyInfo> selectMyPage(VoPage voPage, HttpSession session,PtMoneyInfo ptMoneyInfo) {
        Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("page", (voPage.getPage() - 1)*voPage.getLimit());
        paramMap.put("limit", voPage.getLimit());
        List<PtMoneyInfo> list = baseMapper.selectMyPage(paramMap ,ptMoneyInfo);
        Integer count = baseMapper.countMyPage(paramMap );
        ResultPage<PtMoneyInfo>resultPage=new ResultPage<>();
        resultPage.setCode(0);
        resultPage.setCount(count);
        resultPage.setMsg("成功");
        resultPage.setData(list);
        return resultPage;
    }
}
